﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace xna_game_engine.source
{
    public class CombatTextManager
    {
        // Members
        protected List<CombatText> m_lTexts;
        protected SpriteFont m_cFont;
        protected TongaTimer m_cDrawTimer;


        // Functions
        public CombatTextManager()
        {
            m_lTexts = new List<CombatText>();
            m_cDrawTimer = new TongaTimer(0.3);
        }

        public void LoadContent()
        {
        }

        public void Update(GameTime gt)
        {
            if (m_lTexts.Count > 0)
            {
                m_lTexts[0].Update(gt);
                if (!m_lTexts[0].IsActive())
                {
                    m_lTexts.RemoveAt(0);
                }
            }
        }

        public void Draw()
        {
            foreach (CombatText text in m_lTexts)
            {
                text.Draw();
            }
        }

        public void Trigger(BaseCharacter g, string text, Color color, float xOffset)
        {
            CombatText temp = new CombatText(g, xOffset);
            //temp.Trigger(text, color);
            m_lTexts.Add(temp);
        }
    }
}
